//
//  ChatMessage.m
//  YSTChatUIKit
//
//  Created by 王文文 on 2018/2/13.
//  Copyright © 2018年 王文文. All rights reserved.
//

#import "ChatMessage.h"

@implementation ChatMessage

- (void)setWithDict:(NSDictionary *)dict {
    self.userHeadImage = dict[@"strIcon"];
    self.userName = dict[@"strName"];
    self.userId = [dict[@"strId"] integerValue];
    self.userType =[dict[@"from"] intValue];
    
    switch ([dict[@"type"] integerValue]) {
        case 0:
            self.messageType = messageTypeText;
            self.messageContent = dict[@"strContent"];
            break;
            
        case 1:
            self.messageType = messageTypePicture;
            self.picture = dict[@"picture"];
            break;
        case 2:
              self.messageType = messageTypeVoice;
            break;
        case 3:
            self.messageType = messageTypeVideo;
            break;
        case 4:
            self.messageType = messageTypeTemplate;
            break;
        case 5:
            self.messageType = messageTypeFile;
            break;
        case 6:
            self.messageType = messageTypeFolder;
            break;
          
            
        default:
            break;
    }
}




@end
